<?php

$page->title = ucfirst($page->collection) . ' Collection';
$link_prefix = 'gallery/';

?>

<hgroup class="onWallpaper">
    <h1><?= $page->title ?></h1>
    <p>Project images that match the ‘<?= $page->collection ?>’ tag.</p>
</hgroup>

<ul class="block-grid three-up album">
    <?php foreach( $page->gallery as $key => $image ) : ?>
    <li>
        <figure>
            <a href="<?= url( $link_prefix . $key ) ?>">
                <img src="<?= $image->thumb ?>">
            </a>
            <figcaption>
                <?php if( isset( $image->caption )): ?>
                <p><?php echo $image->caption ?></p>
                <?php endif ?>
            </figcaption>
        </figure>
    </li>
    <?php endforeach ?>
</ul>
